﻿using Microsoft.EntityFrameworkCore;
using Shop.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Application.Products
{
   public class DeleteProduct
    {
        private DBContext _context;

        public DeleteProduct(DBContext context)
        {
            _context = context;
        }

        public bool Do(Guid id) =>
           _context.Products.Remove( _context.Products.FirstOrDefault(x=>x.ProductID==id)).IsKeySet;
    }
}
